import request from '@/utils/request.js';

//邻里圈
// 获取帖子列表
export function getCommunityList(data) {
    return request.get('/community/post/list', data);
}

// 创建帖子
export function postCommunityCreate(data) {
    return request.post('/community/post/create', data);
}

// 帖子详情
export function postCommunityDetail(data) {
    return request.get(`/community/post/detail/${data}`);
}

// 删除帖子
export function postCommunityDelete(data) {
    return request.post(`/community/post/delete/${data}`);
}

// 点赞帖子
export function postCommunityLike(data) {
    return request.post(`/community/post/like/${data}`);
}

// 取消点赞帖子
export function postCommunityUnlike(data) {
    return request.post(`/community/post/unlike/${data}`);
}

// 收藏帖子
export function postCommunityCollect(data) {
    return request.post(`/community/post/collect/${data}`);
}

// 取消收藏帖子
export function postCommunityUncollect(data) {
    return request.post(`/community/post/uncollect/${data}`);
}

// 创建帖子评论
export function postCommunityCommentCreate(data) {
    return request.post(`/community/comment/create`, data);
}

// 获取帖子评论列表
export function getCommunityCommentList(data) {
    return request.get(`/community/comment/list/${data.id}`, data);
}

// 删除帖子评论
export function postCommunityCommentDelete(data) {
    return request.post(`/community/comment/delete/${data}`);
}

// 点赞帖子评论
export function postCommunityCommentLike(data) {
    return request.post(`/community/comment/like/${data}`);
}

// 点赞帖子评论
export function postCommunityCommentUnlike(data) {
    return request.post(`/community/comment/unlike/${data}`);
}

// 获取用户收藏的帖子列表
export function getCommunityUserCollects() {
    return request.get(`/community/user/collects`);
}

// 转发帖子
export function postCommunityPostShare(data) {
    return request.post(`/community/post/share`, data);
}

// 获取用户转发帖子列表
export function getCommunityPostShares() {
    return request.get(`/community/post/shares`);
}

// 根据评论id获取回复
export function getCommunityCommentReplies(data) {
    return request.get(`/community/comment/replies/${data.id}`, data);
}

// 邻里讯
// 生活小贴士列表
export function getCommunitynewsLifetipList(data) {
    return request.get(`/communitynews/lifetip/list`, data);
}

// 生活小贴士详情
export function getCommunitynewsLifetipDetail(data) {
    return request.get(`/communitynews/lifetip/detail/${data.id}`);
}

// 发布生活小贴士
export function postCommunitynewsLifetipPublish(data) {
    return request.post(`/communitynews/lifetip/publish`, data);
}

// 热门话题列表
export function getCommunitynewsTopicHot(data) {
    return request.get(`/communitynews/topic/hot`, data);
}

// 话题广场列表
export function getCommunitynewsTopicSquare(data) {
    return request.get(`/communitynews/topic/square`, data);
}

// 话题详情
export function getCommunitynewsTopicDetail(data) {
    return request.get(`/communitynews/topic/detail/${data.id}`);
}

// 话题评论列表
export function getCommunitynewsTopicComments(id, data) {
    return request.get(`/communitynews/topic/comments/${id}`,data);
}

// 话题评论回复列表
export function getCommunitynewsCommentsReplies(id, data) {
    return request.get(`/communitynews/comment/replies/${id}`,data);
}

// 添加话题评论
export function postCommunitynewsTopicCommentsAdd(data) {
    return request.post(`/communitynews/topic/comment/add`, data);
}

// 点赞话题
export function postCommunitynewsTopicLike(data) {
    return request.post(`/communitynews/topic/like/${data.id}`);
}

// 取消点赞话题
export function postCommunitynewsTopicUnlike(data) {
    return request.post(`/communitynews/topic/unlike/${data.id}`);
}

// 分享话题
export function postCommunitynewsTopicShare(data) {
    return request.post(`/communitynews/topic/share/${data.id}`);
}

// 收藏话题
export function postCommunitynewsTopicFavorite(data) {
    return request.post(`/communitynews/topic/favorite/${data.id}`);
}

// 取消收藏话题
export function postCommunitynewsTopicUnfavorite(data) {
    return request.post(`/communitynews/topic/unfavorite/${data.id}`);
}

// 社区通知列表
export function getCommunitynewsNoticeList(data) {
    return request.get(`/communitynews/notice/list`, data);
}

// 社区通知详情
export function getCommunitynewsNoticeDetail(data) {
    return request.get(`/communitynews/notice/detail/${data.id}`);
}

// 政策解读列表
export function getCommunitynewsPolicyList(data) {
    return request.get(`/communitynews/policy/list`, data);
}

// 政策解读详情
export function getCommunitynewsPolicyDetail(data) {
    return request.get(`/communitynews/policy/detail/${data.id}`);
}

// 发布话题
export function postCommunitynewsTopicCreate(data) {
    return request.post(`/communitynews/topic/create`, data);
}

// 发布社区通知
export function postCommunitynewsNoticePublish(data) {
    return request.post(`/communitynews/notice/publish`, data);
}

// 发布政策解读
export function postCommunitynewsPolicyPublish(data) {
    return request.post(`/communitynews/policy/publish`, data);
}

// 活动话题搜索
export function getCommunitynewsSearch(data) {
    return request.get(`/communitynews/search`, data);
}

// 活动墙
// 活动列表
export function getCommunityactivityList(data) {
    return request.get(`/communityactivity/list`, data);
}

// 活动详情
export function getCommunityactivityDetail(id) {
    return request.get(`/communityactivity/detail/${id}`);
}

// 活动报名
export function postCommunityactivityRegister(data) {
    return request.post(`/communityactivity/register`, data);
}

// 活动收藏
export function postCommunityactivityCollect(data) {
    return request.post(`/communityactivity/collect`, data);
}

// 取消活动收藏
export function postCommunityactivityUncollect(data) {
    return request.post(`/communityactivity/uncollect`, data);
}

// 活动分享
export function postCommunityactivityShare(data) {
    return request.post(`/communityactivity/share`, data);
}

// 发布活动
export function postCommunityactivityPublish(data) {
    return request.post(`/communityactivity/publish`, data);
}

// 逛闲置
// 逛闲置列表
export function getIdleList(data) {
    return request.get(`/idle/list`, data);
}

// 逛闲置详情
export function getIdleDetail(id) {
    return request.get(`/idle/detail/${id}`);
}

// 逛闲置发布
export function postIdlePublish(data) {
    return request.post(`/idle/publish`, data);
}

// 运费模板列表
export function getIdleTransportTemplates(data) {
    return request.get(`/idle/transport/templates`, data);
}

// 确认下单
export function postIdleOrderConfirm(data) {
    return request.post(`/idle/order/confirm`, data);
}

// 确认下单
export function getIdleOrderTransportfee(data) {
    return request.get(`/idle/order/transportfee`, data);
}

// 匠学堂
// 技能列表
export function getCraftsmanSkillList() {
    return request.get(`/craftsman/skill/list`);
}

// 提交报名列表
export function postCraftsmanApplicationSubmit(data) {
    return request.post(`/craftsman/application/submit`,data);
}

// 获取报名记录
export function getCraftsmanApplicationList(data) {
    return request.get(`/craftsman/application/list`, data);
}

// 用户当前最新报名状态
export function getCraftsmanApplicationStatus(data) {
    return request.get(`/craftsman/application/status`, data);
}
